home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / rexx / 2008 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: news1.is.net!news
  2. From: mvantassel@teambca.com (Mark VanTassel)
  3. Newsgroups: comp.lang.rexx
  4. Subject: Re: file I/O
  5. Date: Tue, 16 Apr 1996 15:31:15 GMT
  6. Organization: Barfield, Cauthen and Associates
  7. Distribution: inet
  8. Message-ID: <4l03ve$mig@news1.is.net>
  9. References: <tPbVxgabrokE090yn@blvl.igs.net> <316b52d9.4531377@199.60.229.3> <4kgk9b$f36@vixen.cso.uiuc.edu> <3170a5cd.72870236@199.60.229.3>
  10. NNTP-Posting-Host: dynamic3.is.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. oreo@mindlink.bc.ca (Greg Goss) wrote:
  14.  
  15. >Someone in mail pointed out the lines() function.  
  16.  
  17. >say lines(fnftfm)
  18.  
  19.  
  20. >I tried it and it works.  Mainframe shops tend to buy one subscription
  21. >to manuals, and everyone in the building must make do with 14 year old
  22. >books.  My Rexx book is the 1982 version long before LINES() existed.
  23. >Multisystem rexx authors are trying to get away from execio dependance
  24. >and you don't need it for this question.
  25.  
  26. Beware - lines() doesn't always return the number of lines - sometimes
  27. (in stream-file environments like PCs) it simply returns 1 (meaning "1
  28. or more remaining") or 0 (meaning "EOF").
  29.  
  30. If you mean "multisystem" in the sense of VM & MVS, you're probably OK
  31. with lines()... if you mean it in the more general sense, lines()
  32. won't help you.
  33.  
  34. In fact, it worth pointing out (since this seems to come up a lot)
  35. that in a stream-based system (like PCs, and UNIX (I think!)), there
  36. is ***NO WAY*** to determine the number of "lines" in a file without
  37. counting them. Maybe the utility does it for you, maybe you do it
  38. yourself, but MAKE NO MISTAKE about what's actually going on. If its a
  39. big file, you wait a long time to find out how many "lines" there are.
  40. (I put "lines" in quotes because, in stream-based systems, the OS/File
  41. System has NO concept of a "line" - it's purely a human way of saying
  42. "how many newline characters exist in this long bytestream")
  43.  
  44.  
  45.  
  46. - /\/\ark \/anTassel (mvantassel@teambca.com)
  47.  
  48.